from common.base import Base


# 登录封装

class Login(Base):
    # 输入用户名
    def ipt_usr(self, username):
        self.find_element(('name', 'username')).send_keys(username)

    # 输入密码
    def ipt_ps(self, password):
        self.find_element(('name', 'password')).send_keys(password)

    # 点击记住登录
    def remember(self):
        self.click(('id', 'remember'))

    # 点击登录按钮
    def btn(self):
        self.click(('name', 'submit'))

if __name__ == '__main__':
    b1 = Login('chrome')
    b1.get('https://ecshop.test2.shopex123.com/user.php')
    # 测试登录
    b1.ipt_usr('gulala')
    b1.ipt_ps('gulala123')
    b1.remember()
    b1.btn()

    b1.quit()